package com.Day13.aaa;

import java.util.ArrayList;
import java.util.List;

/**
 * @author: 若若叶
 * @date: 2021/7/29 6:59
 * FileName: Test
 * Description: 生产者，消费者模式(改)
 * 利用此模式交替输出递增的数字
 */
public class Test {
    public static void main(String[] args) {
        List list = new ArrayList();
        Thread t1 = new Thread(new Producer(list));
        Thread t2 = new Thread(new Consumer(list));
        t1.setName("生产者");
        t2.setName("消费者");
        t1.start();
        t2.start();

    }
}
